package application

import (
	"ruoyi/domain/entity/common"
	"ruoyi/domain/entity/response"
	"ruoyi/domain/entity/system"
	"ruoyi/domain/repository"
)

type MenuApp struct {
	menu repository.SysMenuRepository
}

var _ MenuAppInterface = &MenuApp{}

type MenuAppInterface interface {
	SelectMenuTreeByUserId(userId int) []system.SysMenu

	SelectMenuTree(userId int, menu system.SysMenu) []system.SysMenu

	BuildMenuTreeSelect(lists []system.SysMenu) []system.MenuTreeSelect

	BuildChildMenusTreeSelect(ParentId int, lists []system.SysMenu) []system.MenuTreeSelect

	BuildMenus(lists []system.SysMenu) []system.MenuVo

	BuildChildMenus(ParentId int, lists []system.SysMenu) []system.MenuVo

	SelectSysMenuList(params common.SearchTableDataParam) []system.SysMenu

	SelectMenuListByRoleId(roleId string, menuCheckStrictly bool) []int

	SelectSysMenuListByUserId(userId int, params common.SearchTableDataParam) []system.SysMenu

	FindMenuInfoById(menuId string) system.SysMenu

	DeleteMenu(menuIds string) response.Response

	AddMenu(sysMenu system.SysMenu) response.Response

	UpdateMenu(sysMenu system.SysMenu) response.Response
}

func (m *MenuApp) SelectMenuTreeByUserId(userId int) []system.SysMenu {
	return m.menu.SelectMenuTreeByUserId(userId)
}

func (m *MenuApp) BuildMenus(lists []system.SysMenu) []system.MenuVo {
	return m.menu.BuildMenus(lists)
}

func (m *MenuApp) SelectMenuTree(userId int, menu system.SysMenu) []system.SysMenu {
	return m.menu.SelectMenuTree(userId, menu)
}

func (m *MenuApp) BuildMenuTreeSelect(lists []system.SysMenu) []system.MenuTreeSelect {
	return m.menu.BuildMenuTreeSelect(lists)
}

func (m *MenuApp) BuildChildMenusTreeSelect(ParentId int, lists []system.SysMenu) []system.MenuTreeSelect {
	return m.menu.BuildChildMenusTreeSelect(ParentId, lists)
}

func (m *MenuApp) BuildChildMenus(ParentId int, lists []system.SysMenu) []system.MenuVo {
	return m.menu.BuildChildMenus(ParentId, lists)
}

func (m *MenuApp) SelectSysMenuList(params common.SearchTableDataParam) []system.SysMenu {
	return m.menu.SelectSysMenuList(params)
}

func (m *MenuApp) SelectMenuListByRoleId(roleId string, menuCheckStrictly bool) []int {
	return m.menu.SelectMenuListByRoleId(roleId, menuCheckStrictly)
}

func (m *MenuApp) SelectSysMenuListByUserId(userId int, params common.SearchTableDataParam) []system.SysMenu {
	return m.menu.SelectSysMenuListByUserId(userId, params)
}

func (m *MenuApp) FindMenuInfoById(menuId string) system.SysMenu {
	return m.menu.FindMenuInfoById(menuId)
}

func (m *MenuApp) DeleteMenu(menuIds string) response.Response {
	return m.menu.DeleteMenu(menuIds)
}

func (m *MenuApp) AddMenu(sysMenu system.SysMenu) response.Response {
	return m.menu.AddMenu(sysMenu)
}

func (m *MenuApp) UpdateMenu(sysMenu system.SysMenu) response.Response {
	return m.menu.UpdateMenu(sysMenu)
}
